home *** CD-ROM | disk | FTP | other *** search
/ Champak 29 / Volume 29 - JOGO DISK .iso / Games / jungle_adventure.swf / scripts / __Packages / SSMaterial.as < prev    next >
Text File  |  2006-11-29  |  3KB  |  93 lines

  1. class SSMaterial
  2. {
  3.    static var LOW_QUALITY = 0;
  4.    static var MEDIUM_QUALITY = 1;
  5.    static var HIGH_QUALITY = 2;
  6.    static var TEXTURES_ENABLED = true;
  7.    var initialized = false;
  8.    var surfaceTextureMode = 1;
  9.    var surfaceTexturePoint = 0;
  10.    var sideTextureMode = 1;
  11.    var sideTexturePoint = 4;
  12.    var sideTextureAlign = false;
  13.    var rearSurfaceLayer = 10;
  14.    var frontSurfaceLayer = 30;
  15.    var sideSurfaceLayer = 32;
  16.    var bottomSurfaceLayer = 29;
  17.    var sideTextureLayer = 31;
  18.    var layerShift = 0;
  19.    var ambientColor = 6710886;
  20.    var diffuseColor = 10066329;
  21.    var specularColor = 15658751;
  22.    var smoothing = 0;
  23.    var sideSmoothing = 0;
  24.    var smoothingQuality = SSMaterial.HIGH_QUALITY;
  25.    var capSurface = false;
  26.    var endAlign = 1;
  27.    var segmentLine = true;
  28.    var thickness = 10;
  29.    var frontDepth = 10;
  30.    var rearDepth = 10;
  31.    var sideExtrude = 0;
  32.    var bottomDepth = 0;
  33.    var friction = 0.9;
  34.    var traction = 0.5;
  35.    var bounciness = 0.1;
  36.    var emitDust = false;
  37.    var defaultType = "number";
  38.    var types = {impactSound:"string",ambientColor:"hex",diffuseColor:"hex",specularColor:"hex",surfaceTexture:"string",sideTexture:"string"};
  39.    function SSMaterial()
  40.    {
  41.    }
  42.    function prepare()
  43.    {
  44.       if(this.layerShift)
  45.       {
  46.          var _loc2_ = this.layerShift;
  47.          this.rearSurfaceLayer += _loc2_;
  48.          this.frontSurfaceLayer += _loc2_;
  49.          this.sideSurfaceLayer += _loc2_;
  50.          this.bottomSurfaceLayer += _loc2_;
  51.          this.sideTextureLayer += _loc2_;
  52.       }
  53.       if(this.frontDepth < 0)
  54.       {
  55.          this.frontDepth = 0;
  56.       }
  57.       if(this.rearDepth < 0)
  58.       {
  59.          this.rearDepth = 0;
  60.       }
  61.       if(this.thickness < 0)
  62.       {
  63.          this.thickness = 0;
  64.       }
  65.       if(this.bottomDepth < 0)
  66.       {
  67.          this.bottomDepth = 0;
  68.       }
  69.       this.ambientColor = new RGB(this.ambientColor);
  70.       this.diffuseColor = new RGB(this.diffuseColor);
  71.       this.specularColor = new RGB(this.specularColor);
  72.       switch(this.smoothingQuality)
  73.       {
  74.          case 0:
  75.          default:
  76.             this.ratios = [0,255];
  77.             this.alphas = [100,100];
  78.             break;
  79.          case 1:
  80.             this.ratios = [0,128,255];
  81.             this.alphas = [100,100,100];
  82.             break;
  83.          case 2:
  84.             this.ratios = [0,96,159,255];
  85.             this.alphas = [100,100,100,100];
  86.       }
  87.    }
  88.    function toString()
  89.    {
  90.       return "SSMaterial";
  91.    }
  92. }
  93.